﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BDBLoginSet.aspx.cs" Inherits="SysManage_BDBLoginSet" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>外部数据库连接设置</title>
    <link href="../CSS/SubStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Jscript/wyyjs.js"></script>
    <script type="text/javascript" language="javascript">
        function boundvalid() {
            boundsource("txtDBName", "^.+$", "DB名称不能为空", "cmdAdd,cmdEdit");
            boundsource("txtLoginPwd", "^.+$", "密码不能为空", "cmdAdd,cmdEdit");
            boundsource("txtLoginName", "^.+$", "登录名不能为空", "cmdAdd,cmdEdit");
            boundsource("txtServerIP", "^.+$", "服务器IP不能为空", "cmdAdd,cmdEdit");
            boundsource("txtServerName", "^.+$", "服务器名不能为空", "cmdAdd,cmdEdit");
            boundsource("txtCode", "^.+$", "代码不能为空", "cmdAdd,cmdEdit");
        }
    </script>

</head>
<body onload="boundvalid();">
    <form id="form1" runat="server">
        <table cellpadding="0" cellspacing="0" class="topTable">
            <tr>
                <td class="topTd">
                    <asp:Label ID="lblLocation" runat="server" Text="<%$ Resources:language, Location %>"></asp:Label><img
                        alt="当前位置" src="../Image/weizhi.gif" />>><asp:Label ID="Label1" runat="server" Text="外部数据库连接设置"></asp:Label><asp:Label
                            ID="Label2" runat="server" Text="<%$ Resources:language, Must1 %>"></asp:Label><font
                                color="#ff0000">*</font><asp:Label ID="Label3" runat="server" Text="<%$ Resources:language, Must2 %>"></asp:Label>
                </td>
            </tr>
        </table>
        <fieldset style="width: 98%;">
            <legend><font style="font-size: 12px;">
                <asp:Label ID="lblLegend1" runat="server" Text="<%$ Resources:language, Legend1 %>"></asp:Label></font></legend>
            <div style="width: 100%;" align="center">
                <table border="0" cellpadding="0" cellspacing="0" class="InputTable">
                    <tr>
                        <td colspan="1" class="topTdInput">
                            <table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">
                                <tr>
                                    <td class="trHeadFoot" colspan="7">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td10">
                                        <font color="#ff0000">*</font><asp:Label ID="Label4" runat="server" Text="数据库编号"></asp:Label>:</td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtCode" CssClass="txtStyle" runat="server"></asp:TextBox>
                                    </td>
                                    <td class="td10">
                                        <asp:Label ID="Label5" runat="server" Text="服务器名"></asp:Label>:
                                    </td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtServerName" runat="server" CssClass="txtStyle"></asp:TextBox>
                                    </td>
                                    <td class="td10">
                                        <span style="color: #ff0000">*</span><asp:Label ID="Label10" runat="server" Text="服务器IP"></asp:Label>:
                                    </td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtServerIP" CssClass="txtStyle" runat="server"></asp:TextBox>
                                    </td>
                                    <td class="td10"> </td>
                                </tr>
                                <tr>
                                    <td class="td10">
                                        <span style="color: #ff0000">*</span><asp:Label ID="Label11" runat="server" Text="数据库名"></asp:Label>:</td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtDBName" runat="server" CssClass="txtStyle"></asp:TextBox>
                                    </td>
                                    <td class="td10">
                                        <span style="color: #ff0000">*</span><asp:Label ID="Label12" runat="server" Text="用户名"></asp:Label>:
                                    </td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtLoginName" runat="server" CssClass="txtStyle"></asp:TextBox>
                                    </td>
                                    <td class="td10">
                                        <span style="color: #ff0000">*</span><asp:Label ID="Label13" runat="server" Text="<%$ Resources:hwlan, cpwd %>"></asp:Label>:
                                    </td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtLoginPwd" 
                                            runat="server" CssClass="txtStyle"></asp:TextBox></td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td class="td10">
                                        <asp:Label ID="Label14" runat="server" Text="数据库For:"></asp:Label></td>
                                    <td class="td20">
                                        <asp:DropDownList ID="ddlDBForFlag" runat="server" Width="100%">
                                            <asp:ListItem Value="1">Trading</asp:ListItem>
                                            <asp:ListItem Value="2">Plant</asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                    <td class="td10">
                                        <asp:Label ID="Label15" runat="server" Text="数据库类型:"></asp:Label>
                                    </td>
                                    <td class="td20">
                                        <asp:DropDownList ID="ddlDBType" runat="server" Width="100%">
                                            <asp:ListItem Value="0">SQL Server</asp:ListItem>
                                            <asp:ListItem Value="1">DB2</asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                    <td class="td10">
                                        &nbsp;</td>
                                    <td class="td20">
                                        &nbsp;</td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td class="td10" align="right">
                                        <asp:Label ID="Label9" runat="server" Text="<%$ Resources:hwlan, desc %>"></asp:Label>:
                                    </td>
                                    <td class="td20" colspan="5">
                                        <asp:TextBox ID="txtDesc" CssClass="txtStyle" runat="server"></asp:TextBox>
                                    </td>
                                    <td class="trHeadFoot"></td>
                                </tr>
                                <tr>
                                    <td class="trHeadFoot" colspan="7">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <div class="cmdButtonsDiv">
                            &nbsp;<asp:Button ID="cmdAdd" runat="server" Text="<%$ Resources:hwlan, insert %>"
                                CssClass="cmdStyle" OnClick="cmdAdd_Click" />
                            &nbsp;<asp:Button ID="cmdEdit" runat="server" Text="<%$ Resources:hwlan, edit %>"
                                CssClass="cmdStyle" Enabled="False" OnClick="cmdEdit_Click" />
                            <asp:Button ID="cmdReset" runat="server" Text="<%$ Resources:hwlan, reset %>"  CssClass="cmdStyle" OnClick="cmdReset_Click" />
                </div>
            </div>
        </fieldset>
        <fieldset style="width: 98%;">
            <legend><font style="font-size: 12px;">
                <asp:Label ID="lblLegend2" runat="server" Text="<%$ Resources:language, Legend2 %>"></asp:Label></font></legend>
            <div class="grvDiv">
                    <asp:GridView ID="Grv" runat="server" Width="100%" AutoGenerateColumns="False" CssClass="gvStyle"
                        AllowPaging="True" GridLines="None" PageSize="20" OnRowDeleting="Grv_RowDeleting"
                        OnRowDataBound="Grv_RowDataBound" 
                        OnPageIndexChanging="Grv_PageIndexChanging" DataKeyNames="DBForFlag,DBLoginPwd,DBType" 
                        onselectedindexchanged="Grv_SelectedIndexChanged">
                        <HeaderStyle CssClass="gvHeader" />
                        <RowStyle CssClass="gvRow" />
                        <AlternatingRowStyle CssClass="gvAllRow" />
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    NO.</HeaderTemplate>
                                <ItemTemplate>
                                    <%#Grv.PageIndex * Grv.PageSize + Grv.Rows.Count + 1%>
                                </ItemTemplate>
                                <ItemStyle CssClass="gvItem" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="DBCode" HeaderText="数据库编号">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="DBServerName" HeaderText="服务器名">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="DBServerIP" HeaderText="服务器IP">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="DBName" HeaderText="数据库名">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="DBLoginName" HeaderText="数据库登录账号">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="DBForFlagName" HeaderText="数据库For">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="DBTypeName" HeaderText="数据库类型">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="DBDesc" HeaderText="<%$ Resources:hwlan, desc %>">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:CommandField HeaderText="<%$ Resources:language, Edit %>" ShowSelectButton="true"
                                SelectText="&lt;img border=0 alt=&quot;Edit&quot; src=../Image/edit.gif&gt;">
                                <ItemStyle CssClass="gvItem" />
                            </asp:CommandField>
                            <asp:CommandField ShowDeleteButton="True" DeleteText="&lt;img border=0 alt=&quot;Delete&quot; src=../Image/del.gif&gt;"
                                HeaderText="<%$ Resources:language, Delete %>">
                                <ItemStyle CssClass="gvItem" />
                            </asp:CommandField>
                        </Columns>
                        <PagerTemplate>
                            <table style="text-align: center;">
                                <tr>
                                    <td>
                                        <asp:Label ID="LabelCurrentPage" runat="server" Font-Size="Small">当前显示第<%# ((GridView)Container.NamingContainer).PageIndex + 1 %>页</asp:Label></td>
                                    <td>
                                        <asp:Label ID="LabelPageCount" runat="server" Font-Size="Small">&nbsp; 共有<%# ((GridView)Container.NamingContainer).PageCount %>页</asp:Label></td>
                                    <td>
                                        <asp:LinkButton ID="LinkButtonFirstPage" runat="server" CommandArgument="First" CommandName="Page"
                                            Font-Underline="False" Enable="<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>"
                                            Font-Size="Small">&nbsp; 首页</asp:LinkButton></td>
                                    <td>
                                        <asp:LinkButton ID="LinkButtonPreviousPage" runat="server" CommandArgument="Prev"
                                            Font-Underline="False" CommandName="Page" Enable="<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>"
                                            Font-Size="Small">&nbsp;上一页</asp:LinkButton></td>
                                    <td>
                                        <asp:LinkButton ID="LinkButtonNextPage" runat="server" CommandArgument="Next" CommandName="Page"
                                            Font-Underline="False" Enable="<%# ((GridView)Container.NamingContainer).PageIndex != ((GridView)Container.NamingContainer).PageCount - 1 %>"
                                            Font-Size="Small">&nbsp;下一页</asp:LinkButton></td>
                                    <td>
                                        <asp:LinkButton ID="LinkButtonLastPage" runat="server" CommandArgument="Last" CommandName="Page"
                                            Font-Underline="False" Enable="<%# ((GridView)Container.NamingContainer).PageIndex != ((GridView)Container.NamingContainer).PageCount - 1 %>"
                                            Font-Size="Small">&nbsp;尾页</asp:LinkButton></td>
                                </tr>
                            </table>
                        </PagerTemplate>
                    </asp:GridView>
                </div>
        </fieldset>        
    </form>
</body>
</html>